GXX = arm-uclibc-g++
TARGETLIB = ../libUdpSocket.so
TARGET = server
DEBUG =
DEL_EXIST_LIB=$(shell if [ -f $(TARGETLIB) ]; then echo "-rm $(TARGETLIB)"; else echo "";fi;)

all:
	$(GXX) $(DEBUG) -c -fPIC ../UdpSocket.cpp
	$(GXX) $(DEBUG) -c -fPIC server.cpp
	$(GXX) $(DEBUG) -shared -fPIC -o $(TARGETLIB) UdpSocket.o
	$(GXX) $(DEBUG) -o $(TARGET) server.o $(TARGETLIB)

 .PHONY:clean
clean:
	-rm  -f *.o	$(TARGET) 
	$(DEL_EXIST_LIB)
